import 'package:library_base/entities/generated/json/base/json_convert_content.dart';
import 'package:library_base/entities/goods_child_entity.dart';
import 'package:library_base/entities/goods_entity.dart';

GoodsEntity $GoodsEntityFromJson(Map<String, dynamic> json) {
  final GoodsEntity loginBeanEntity = GoodsEntity();

  final List<GoodsChildEntity> records = jsonConvert.convertList<GoodsChildEntity>(json['records']);
  loginBeanEntity.records = records;

  final int? total = jsonConvert.convert<int>(json['total']);
  if (total != null) {
    loginBeanEntity.total = total;
  }
  final int? size = jsonConvert.convert<int>(json['size']);
  if (size != null) {
    loginBeanEntity.size = size;
  }
  final int? current = jsonConvert.convert<int>(json['current']);
  if (current != null) {
    loginBeanEntity.current = current;
  }
  final int? pages = jsonConvert.convert<int>(json['pages']);
  if (pages != null) {
    loginBeanEntity.pages = pages;
  }

  return loginBeanEntity;
}

Map<String, dynamic> $GoodsEntityToJson(GoodsEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['records'] = entity.records;
  data['total'] = entity.total;
  data['size'] = entity.size;
  data['current'] = entity.current;
  data['pages'] = entity.pages;
  return data;
}
